<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }


        td,
        th {
            border: 0.5px solid #333;
        }

        table {
            line-height: 40px;
            border-collapse: collapse;
        }

        td {
            padding: 0 20px;
        }
    </style>
</head>

<body>
    <table>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
        <tr>
            <td>1x1=01</td>
            <td>2x2=02</td>
            <td>3x3=03</td>
            <td>4x4=04</td>
            <td>5x5=05</td>
            <td>6x6=06</td>
            <td>7x7=07</td>
            <td>8x8=08</td>
            <td>9x9=09</td>
        </tr>
    </table>
</body>
<script>
    // JS打印表格
    // 1. 动态生成之前先写, 静态的
    // 2. document.write("<h2>123132</h2>")  =>可以输出html结构到页面中 -> 解析为标签


    document.write("<table>");

    for (var i = 1; i <= 9; i++) {
        document.write("<tr>");

        for (var j = 1; j <= i; j++) {
            document.write("<td>");
            document.write(j)
            document.write("</td>");
        }


        document.write("</tr>");
    }

    document.write("</table>");


</script>

</html>